﻿using Frameworks;
using SimpleJson;
using UnityEngine;

namespace Networks.Handlers
{
    public class GameHandler
    {
        public static void onRaceWait(JsonObject data)
        {
            Debug.Log("onRaceWait-: " + data);
        }

        public static void onAdd(JsonObject data)
        {
            //Debug.Log("onAdd-: " + data);
            EventProxy.BroadcastEvent(Routes.ON_ADD, data);
        }

        public static void onLeave(JsonObject data)
        {
            //Debug.Log("onLeave-: " + data);
            EventProxy.BroadcastEvent(Routes.ON_LEAVE, data);
        }

        // 收到消息
        public static void onChat(JsonObject data)
        {
            Debug.Log("onChat-: " + data);
            EventProxy.BroadcastEvent(Routes.ON_CHAT, data);
        }

        // 发送消息的回调
        public static void onSendChat(JsonObject data)
        {
            Debug.Log("onSendChat-: " + data);
        }
    }
}